package com.example.mp.controller;


import com.example.mp.service.RAGService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @description:
 * @Author: whopxx
 * @CreateTime: 2025-03-07
 */
@CrossOrigin
@RestController
@RequestMapping("/marketing")
@Tag(name = "RAG", description = "营销方案生成接口")
public class RAGController {

    @Autowired
    private RAGService ragService;

    @GetMapping("/rag/chat")
    @Operation(summary = "获取智能化推荐文案接口")
    public String chatMessage(@RequestParam(value = "prompt",
            defaultValue = "提供提一条个性化营销内容") String prompt) {

        return ragService.retrieve(prompt)
                .getOutput()
                .getContent();
    }
}
